﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Application
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Windows.Forms;

    using Mews.Application.Properties;
    using Mews.Net.Nntp.Cache;

    [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1601:PartialElementsMustBeDocumented", Justification = "Another part already documents the class.")]
    internal partial class MainForm
    {
        /// <summary>Implements the controller for deleted outbound articles.</summary>
        private sealed class MyDeletedArticlesController : MyArticlesControllerBase
        {
            private readonly object document;

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            /// <summary>See <see cref="IController.Document"/>.</summary>
            public sealed override object Document
            {
                get { return this.document; }
            }

            /// <summary>See <see cref="IController.UpdateCount"/>.</summary>
            public sealed override void UpdateCount()
            {
            }

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            internal MyDeletedArticlesController(MainForm mainForm, object document) : base(mainForm, Resources.Restore)
            {
                this.document = document;
            }

            internal sealed override void OnTreeView_KeyDown(object sender, KeyEventArgs e)
            {
                e.Handled = true;
            }

            internal sealed override void OnTreeView_NodeTap(object sender, EventArgs e)
            {
            }

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            /// <summary>See <see cref="MyArticlesControllerBase.FolderName"/>.</summary>
            protected sealed override string FolderName
            {
                get { return Resources.Deleted; }
            }

            /// <summary>See <see cref="MyArticlesControllerBase.GetArticles"/>.</summary>
            protected sealed override IEnumerable<IOutboundArticle> GetArticles()
            {
                return this.MainForm.cache.GetDeletedOutboundArticles();
            }
        }
    }
}
